## API Report File for "@backstage/plugin-search-common"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="node" />

import { JsonObject } from '@backstage/types';
import { Permission } from '@backstage/plugin-permission-common';
import { Readable } from 'stream';
import { Transform } from 'stream';
import { Writable } from 'stream';

// @public
export interface DocumentCollatorFactory {
  getCollator(): Promise<Readable>;
  readonly type: string;
  readonly visibilityPermission?: Permission;
}

// @public
export interface DocumentDecoratorFactory {
  getDecorator(): Promise<Transform>;
  readonly types?: string[];
}

// @public
export type DocumentTypeInfo = {
  visibilityPermission?: Permission;
};

// @public
export type IndexableDocument = SearchDocument & {
  authorization?: {
    resourceRef: string;
  };
};

// @public (undocumented)
export type IndexableResult = Result<IndexableDocument>;

// @public (undocumented)
export type IndexableResultSet = ResultSet<IndexableDocument>;

// @public
export type QueryRequestOptions = {
  token?: string;
};

// @public
export type QueryTranslator = (query: SearchQuery) => unknown;

// @public (undocumented)
export interface Result<TDocument extends SearchDocument> {
  document: TDocument;
  highlight?: ResultHighlight;
  rank?: number;
  type: string;
}

// @public
export interface ResultHighlight {
  // (undocumented)
  fields: {
    [field: string]: string;
  };
  postTag: string;
  preTag: string;
}

// @public (undocumented)
export interface ResultSet<TDocument extends SearchDocument> {
  // (undocumented)
  nextPageCursor?: string;
  // (undocumented)
  numberOfResults?: number;
  // (undocumented)
  previousPageCursor?: string;
  // (undocumented)
  results: Result<TDocument>[];
}

// @public
export interface SearchDocument {
  location: string;
  text: string;
  title: string;
}

// @public
export interface SearchEngine {
  getIndexer(type: string): Promise<Writable>;
  query(
    query: SearchQuery,
    options?: QueryRequestOptions,
  ): Promise<IndexableResultSet>;
  setTranslator(translator: QueryTranslator): void;
}

// @public (undocumented)
export interface SearchQuery {
  // (undocumented)
  filters?: JsonObject;
  // (undocumented)
  pageCursor?: string;
  // (undocumented)
  pageLimit?: number;
  // (undocumented)
  term: string;
  // (undocumented)
  types?: string[];
}

// @public (undocumented)
export type SearchResult = Result<SearchDocument>;

// @public (undocumented)
export type SearchResultSet = ResultSet<SearchDocument>;
```
